<?php
require_once("lib/db_connection.php");

$where = $_GET['where'];
$table = $_GET['table'];
$field = $_GET['field'];

$query_unique = "SELECT ".$field." FROM ".$table." WHERE ".$field."='".$where."'";
$result_unique = mysql_query($query_unique) or die("UNIQUE ".mysql_error());
$count_unique = mysql_num_rows($result_unique);

if($count_unique>0)
{
 echo "1";
}
if($count_unique==0)
{
 echo "0";
}
?>